package com.module.overview.ui.cardHistoryDetails

import androidx.annotation.Nullable
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter


/**
 *
 * 作者：sosou
 *
 * 版本：1.0
 *
 * 创建日期：18/6/2025
 *
 * 描述：
 *
 * 修订历史：
 *
 */
class CardHistoryDetailsAdapter(fm: FragmentManager, fragments: List<Fragment>, titles: List<String>) :
    FragmentPagerAdapter(fm) {
    private val fragments: List<Fragment>
    private val titles: List<String>

    init {
        this.fragments = fragments
        this.titles = titles
    }

    override fun getItem(position: Int): Fragment {
        return fragments[position]
    }

    override fun getCount(): Int {
        return fragments.size
    }

    @Nullable
    override fun getPageTitle(position: Int): CharSequence {
        return titles[position]
    }
}